package cn.usian.client;

import cn.usian.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

//创建feign的客户端
@FeignClient("userservice") //等同于调用
public interface UserClient {
    //调用userservice服务
    @GetMapping("/user/{id}")
    User findById(@PathVariable Long id);
    @GetMapping("/user/findAll")
        List<User>findAll();
}
